package com.chench.interview.spring;

import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Scope(value = "singleton")
@RestController
public class SingletonTest {
    private int number = 0;

    @GetMapping(value = "/api/getNumber1")
    public int number1(){
        number++;
        return this.number;
    }
    @GetMapping(value = "/api/getNumber2")
    public int number2(){
        number++;
        return this.number;
    }
}
